package zut.edu.cs.network.thread.deadlock;

public class DeadLock implements Runnable {
	A a = new A();
	B b = new B();
	public void init() {
		Thread.currentThread().setName("主线程");
		a.foo(b);
		System.out.println("进入了主线程之后");
	}
	
	@Override
	public void run() {
		Thread.currentThread().setName("副线程");
		b.foo(a);
		System.out.println("进入了副线程之后");
	}

	public static void main(String[] args) {
		DeadLock d1 = new DeadLock();
		new Thread(d1).start();
		d1.init();

	}

	

}
